.class public Lcom/estrongs/android/taskmanager/AutoAirplaneModeCastReceiver;
.super Landroid/content/BroadcastReceiver;


# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    return-void
.end method


# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 12

    const/16 v11, 0xc

    const/16 v10, 0xb

    const/4 v9, 0x6

    const/4 v8, 0x1

    const/4 v5, 0x0

    const-string v0, "android.intent.action.BOOT_COMPLETED"

    invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-static {p1}, Lcom/estrongs/android/taskmanager/dp;->d(Landroid/content/Context;)V

    :cond_0
    :goto_0
    return-void

    :cond_1
    const-string v0, "EXTRA_KEY_MODE_START"

    invoke-virtual {p2, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    const-string v1, "1"

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_7

    const-string v0, "EXTRA_KEY_WEEKS"

    invoke-virtual {p2, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    const-string v1, "EXTRA_KEY_ID"

    invoke-virtual {p2, v1, v5}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v1

    const-string v2, "EXTRA_KEY_STOT_HOUR"

    invoke-virtual {p2, v2, v5}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v2

    const-string v3, "EXTRA_KEY_STOT_MINUTE"

    invoke-virtual {p2, v3, v5}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v3

    const-string v4, "EXTRA_KEY_STOT_TIME_AT_TOMORROW"

    invoke-virtual {p2, v4, v5}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v4

    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v5

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v6

    invoke-virtual {v5, v6, v7}, Ljava/util/Calendar;->setTimeInMillis(J)V

    const/4 v6, 0x7

    invoke-virtual {v5, v6}, Ljava/util/Calendar;->get(I)I

    move-result v6

    invoke-static {v6}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v0, v6}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-static {p1}, Lcom/estrongs/android/taskmanager/tools/a;->a(Landroid/content/Context;)Z

    move-result v0

    if-eqz v0, :cond_0

    new-instance v0, Lcom/estrongs/android/taskmanager/tools/e;

    invoke-direct {v0, p1}, Lcom/estrongs/android/taskmanager/tools/e;-><init>(Landroid/content/Context;)V

    invoke-virtual {v0, v1}, Lcom/estrongs/android/taskmanager/tools/e;->b(I)Landroid/database/Cursor;

    move-result-object v6

    if-eqz v6, :cond_2

    invoke-interface {v6}, Landroid/database/Cursor;->getCount()I

    move-result v7

    if-nez v7, :cond_3

    :cond_2
    invoke-static {p1, v1}, Lcom/estrongs/android/taskmanager/o;->a(Landroid/content/Context;I)V

    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    invoke-virtual {v0}, Lcom/estrongs/android/taskmanager/tools/e;->b()V

    goto :goto_0

    :cond_3
    invoke-virtual {v0}, Lcom/estrongs/android/taskmanager/tools/e;->b()V

    invoke-static {p1, v8}, Lcom/estrongs/android/taskmanager/o;->a(Landroid/content/Context;Z)V

    invoke-virtual {v5, v10}, Ljava/util/Calendar;->get(I)I

    move-result v0

    invoke-virtual {v5, v11}, Ljava/util/Calendar;->get(I)I

    move-result v1

    if-gt v0, v2, :cond_4

    if-ne v0, v2, :cond_5

    if-le v1, v3, :cond_5

    :cond_4
    invoke-virtual {v5, v9, v8}, Ljava/util/Calendar;->add(II)V

    :cond_5
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    invoke-virtual {v5, v0, v1}, Ljava/util/Calendar;->setTimeInMillis(J)V

    if-lt v4, v8, :cond_6

    invoke-virtual {v5, v9, v8}, Ljava/util/Calendar;->add(II)V

    :cond_6
    invoke-virtual {v5, v10, v2}, Ljava/util/Calendar;->set(II)V

    invoke-virtual {v5, v11, v3}, Ljava/util/Calendar;->set(II)V

    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/estrongs/android/taskmanager/AutoAirplaneModeCastReceiver;

    invoke-direct {v0, p1, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    const-string v1, "EXTRA_KEY_MODE_START"

    const-string v2, "0"

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const/4 v1, -0x1

    const/high16 v2, 0x1000

    invoke-static {p1, v1, v0, v2}, Landroid/app/PendingIntent;->getBroadcast(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v1

    const-string v0, "alarm"

    invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/AlarmManager;

    invoke-virtual {v5}, Ljava/util/Calendar;->getTimeInMillis()J

    move-result-wide v2

    invoke-virtual {v0, v8, v2, v3, v1}, Landroid/app/AlarmManager;->set(IJLandroid/app/PendingIntent;)V

    goto/16 :goto_0

    :cond_7
    const-string v1, "0"

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-static {p1, v5}, Lcom/estrongs/android/taskmanager/o;->a(Landroid/content/Context;Z)V

    goto/16 :goto_0
.end method
